
import info.gridworld.actor.Actor;

import java.io.PrintStream;
import java.io.PrintWriter;
import java.util.*;


/**
 * TODO TBW
 * 
 * @author Unkwn
 * @version Apr 22, 2014
 * @author Period: 2
 * @author Assignment: z.game
 * 
 * @author Sources: TODO
 */
public class Town extends Actor
{
    String[] menu = { "Select a Shop", "Inn", "Blacksmith", "Bar" };
    Scanner scan = new Scanner( System.in );
    
    // http://goo.gl/Q8TIOV
    public Town()
    {
    }


    public void act()
    {
    }
    
    public void display()
    {
        System.out.println( menu[0] );
        for ( int i = 1; i < menu.length; i++ )
        {
            System.out.println( i + " - " + menu[i] );
        }
        if(scan.nextInt()==1)
        {
            Inn();
        }
        else if(scan.nextInt()==2)
        {
            Blacksmith();
        }
        else if(scan.nextInt()==3)
        {
            Bar();
        }
        else
        {
            System.out.println("Invalid command, try again");
            display();
        }
    }


    public void Inn()
    {
        System.out.println("Need a Room?");
        String[] innMenu = {"Get a Room (5 Gold)","Leave"};
        for ( int i = 0; i < innMenu.length; i++ )
        {
            System.out.println( i+1 + " - " + innMenu[i] );
        }
        if(scan.nextInt()==1)
        {
            // decrease player money amt
            // restore stats
        }
        else if( scan.nextInt()==2)
        {
            display();
        }
        else
        {
            System.out.println("Invalid command, try again");
            Inn();
        }
    }


    public void Blacksmith()
    {
        System.out.print("You see a large muscular man pounding away on the anvil");
        String[] blackMenu = {"Enhance your gear (scaled price)","Leave"};
        for ( int i = 0; i < blackMenu.length; i++ )
        {
            System.out.println( i+1 + " - " + blackMenu[i] );
        }
        if(scan.nextInt()==1)
        {
            // decrease player money amt
            // increase stats
        }
        else if( scan.nextInt()==2)
        {
            display();
        }
        else
        {
            System.out.println("Invalid command, try again");
            Blacksmith();
        }
    }


    public void Bar()
    {
        String[] barMenu = { "Buy an Ale (10 Gold)",
            "Recruit a Fighter", "Leave" };
        System.out.print( "What Can I Get For You?" );
        for ( int i = 0; i < barMenu.length; i++ )
        {
            System.out.println( i + 1 + " - " + barMenu[i] );
        }
        if(scan.nextInt()==1)
        {
            // decrease player money amt
            // modify stats temporarily
        }
        else if(scan.nextInt()==2)
        {
            // recruit tab
        }
        else if( scan.nextInt()==3)
        {
            display();
        }
        else
        {
            System.out.println("Invalid command, try again");
            Bar();
        }
    }


    public static void main( String[] args )
    {
        Town t = new Town();
        t.display();
    }
}